<?php
define("INWEB",true);
include('include/config.php');
head('Smilies',0); 
                $htmlout = '';
    $htmlout = "
    <script type='text/javascript'>
    function SmileIT(smile,form,text){
    window.opener.document.forms[form].elements[text].value = window.opener.document.forms[form].elements[text].value+' '+smile+' ';
    window.opener.document.forms[form].elements[text].focus();
    window.close();
    }
    </script>
    <table width='100%' cellpadding='1' cellspacing='1'>";
    $count='';
    while ((list($code, $url) = each($smilies))) {
    if ($count % 3 == 0)
    $htmlout .= " \n<tr>";
    $htmlout .= "\n\t<td class=\"list\" align=\"center\"><a href=\"javascript: SmileIT('" . str_replace("'", "\'", $code) . "','" . htmlspecialchars($_GET["form"]) . "','" . htmlspecialchars($_GET["text"]) . "')\"><img border='0' src='img/smilies/" . $url . "' alt='' /></a></td>";
    $count++;
    if ($count % 3 == 0)
    $htmlout .= "\n</tr>";
    }
    $htmlout .= "</tr></table><div align='center'><a href='javascript: window.close()'>[ Close Window ]</a></div></body></html>";

print $htmlout;
foot(0);
?>